from scipy import ndimage
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt

image = Image.open('image.png').convert('L')
img_array = np.array(image).astype(float) 

smoothed_array = ndimage.gaussian_filter(img_array, sigma=2)

plt.figure(figsize=(10, 5))
plt.subplot(1, 2, 1)
plt.imshow(img_array, cmap='gray')
plt.title('Original (Noisy)')

plt.subplot(1, 2, 2)
plt.imshow(smoothed_array, cmap='gray')
plt.title('Gaussian Smoothed')

plt.show()